// 引入接口函数
import {reqGetShopCart} from '@/api/shopCart.js'
export default {
  // 开启了模块命名,映射记得写模块名
  namespaced: true,
  state: {
    // 获取购物车列表
    shopCarts:[]
  },
  actions: {
    async getShopCartList({commit}){
       const shopCarts=await reqGetShopCart()
       commit('GET_SHOP_CART_LIST',shopCarts)
    },
  },
  mutations: {
    // 更新数据
    GET_SHOP_CART_LIST(state,shopCarts){
      state.shopCarts=shopCarts
    }
  },
  getters: {}
}